<%@ page import="com.zzc.bean.Employee" %>
<%@ page import="java.util.List" %>
<%@ page import="com.zzc.bean.Techer" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.net.URLDecoder" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="com.zzc.bean.Dining" %>
<%@ page import="com.zzc.bean.DiningReceipt" %>
<%--
  Created by IntelliJ IDEA.
  Employee: HP
  Date: 2017/11/7
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Title</title>
</head>
<script type="text/javascript" src="<%=path%>/assets/js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="<%=path%>/assets/js/main.js"></script>
<script type="text/javascript" src="<%=path%>/assets/js/diningReceipt_opration.js"></script>
<script type="text/javascript" src="<%=path%>/assets/js/dateTool.js"></script>
<link href="<%=path%>/assets/bootstrap/css/bootstrap.css" rel="stylesheet" />

<body>
<div align="right">
    <%
        Employee employee= (Employee) session.getAttribute("employee");
        boolean flag_admin=false;
        if (employee.getEmployee_account().equals("admin")){
            flag_admin=true;
        }
    %>
    <button id="button_falg_allData" onclick="onclick_falg_allData('${pageContext.request.contextPath}',<%=flag_admin%>,0)">Muestran todos los datos</button>
</div>
<%
    List<DiningReceipt> list_diningReceipts = (List<DiningReceipt>) request.getAttribute("list_diningReceipts");
%>
<%
    //筛选数据功能，汇总信息，汇总所有的公司
%>
<div align="center">
<table class="table table-hover table table-striped">
    <tr>
        <%--<%--%>
            <%--if (flag_admin){--%>
        <%--%>--%>
        <td>Num. de reserva</td>
        <td>Num. de usuario</td>
        <%--<%--%>
            <%--}--%>
        <%--%>--%>
        <td>Nom. de empresa</td>
        <td>Fecha</td>
        <td>Tipo</td>
        <td>Num. de dirigentes</td>
        <td>Num. de empleados</td>
        <td>Notas</td>
        <%--<td>编辑</td>--%>
    </tr>
    <tr>
        <%--<%--%>
            <%--if (flag_admin){--%>
        <%--%>--%>
        <td>
        </td>
        <td>
        </td>
        <%--<%--%>
            <%--}--%>
        <%--%>--%>
        <td>
            Nom. de empresa:<input id="dining_company_filter" type="text" name="dining_company" value=""  onkeyup="filterDiningReceipt(true,0)"/><!--<%=flag_admin%> -->
        </td>
        <td>
            Fecha:<input id="dining_time_filter" type="datetime-local" value="2018-01-01T11:00:00" onchange="filterDiningReceipt_andReQuerySql(true,0)"/>-Hoy
        </td>
        <td>
            Tipo:
            <select id="dining_type_filter" name="dining_type" data-options="editable:false" onchange="filterDiningReceipt(true,0)" value="">
                <option value=""></option>
                <option value="Almuerzo">Almuerzo</option>
                <option value="Cena">Cena</option>
            </select>
        </td>
    </tr>
    <tbody id="tb">
    <%--<%--%>
        <%--if(list_diningReceipts!=null&&list_diningReceipts.size()>0)--%>
        <%--{--%>
            <%--for(int i=0;i<list_diningReceipts.size();i++)--%>
            <%--{--%>
                <%--DiningReceipt diningReceipt = list_diningReceipts.get(i);--%>
    <%--%>--%>

    <%--<tr id="tr_<%=diningReceipt.getDining_id()%>">--%>
        <%--<td><%=diningReceipt.getDining_id()%></td>--%>
        <%--<td><%=diningReceipt.getEmployee_account()%></td>--%>
        <%--<td><%=diningReceipt.getDining_company() %></td>--%>
        <%--<td><%=diningReceipt.getDining_time() %></td>--%>
        <%--<td><%=diningReceipt.getDining_type() %></td>--%>
        <%--<td><%=diningReceipt.getLeadership_number() %></td>--%>
        <%--<td><%=diningReceipt.getEmployee_number() %></td>--%>
        <%--<td><%=diningReceipt.getNote() %></td>--%>
        <%--&lt;%&ndash;<td>&ndash;%&gt;--%>
            <%--&lt;%&ndash;<a href="<%=path%>/Action/Action_DiningReceiptAction_alter_get_id?diningReceipt_id=<%=diningReceipt.getDining_id()%>"> <button>修改</button></a>&ndash;%&gt;--%>
            <%--&lt;%&ndash;<button onclick="onClick_DiningReceiptService_delete_id(this,'<%=path%>')">删除</button>&ndash;%&gt;--%>
        <%--&lt;%&ndash;</td>&ndash;%&gt;--%>
    <%--</tr>--%>
    <%--<%--%>
            <%--}--%>
        <%--}--%>
    <%--%>--%>
    </tbody>
</table>
    <div id="div_data_navagation" style="display:inline">
    </div>
</div >
<div align="center">
<a href="<%=path%>/view/diningReceipt/diningReceipt_add.jsp"> <button>Agregar</button></a>
</div>
</body>
<script type="text/javascript">
    var date = new Date()
    date.setMonth(date.getMonth()-1);
    var dining_time_filter_value=dateToString(date)+"T11:00:00";
    $('#dining_time_filter').val(dining_time_filter_value);
    var time_limited1=$('#dining_time_filter').val();
    // var time_limited2=$('#dining_time_filter2').val();
    var timeStamp_filter = new Date(time_limited1).getTime();
    <%--getDiningReceipts("${pageContext.request.contextPath}",<%=flag_admin%>,0);--%><!--按王小姐的需求-->
    getDiningReceipts("${pageContext.request.contextPath}",true,0,timeStamp_filter);
</script>
</html>
